//
//  MsgDetailViewModel.m
//  EnvironmentalProtection
//
//  Created by HCreater on 2018/11/7.
//  Copyright © 2018年 HCreater. All rights reserved.
//

#import "MsgDetailViewModel.h"

#import "SysMsgListData.h"

@interface MsgDetailViewModel ()

@property (nonatomic, copy) NSString* title;
@property (nonatomic, copy) NSString* content;
@property (nonatomic, copy) NSString* time;

@end

@implementation MsgDetailViewModel

#pragma mark - Ovrride
- (void)initialize
{
    [super initialize];
    
    @weakify(self);
    
    [[[RACObserve(self, data) distinctUntilChanged] filter:^BOOL(id value) {
        return value;
    }] subscribeNext:^(id x) {
        @strongify(self);
        
        SysMsgListData* curData = x;
        
        self.title = curData.title;
        self.time = curData.addTime;
        self.content = curData.content;
    }];
}

@end
